To swap two numbers without using a temporary variable, we have multiple approaches. In this article, we are going to learn how to swap two numbers without using a temporary variable....
Given a positive integer n, write a function to find if it is a power of 2 or not...
Given N numbers with no duplicates, count the number of unique triplets (ai, aj, ak) such that their XOR is 0. A triplet is said to be unique if all of the three numbers in the triplet are unique....
Given two positive integers x and y, check if one integer is obtained by rotating bits of other....
Given two positive integers x and y (0 < x, y < 2^32), check if one integer is obtained by rotating bits of the other....
Write an efficient program to count the number of 1s in the binary representation of an integer.Examples :...
Given two 2D binary arrays, a[][] and b[][] both of size M*N, the task is to pair each row in the array a[][] with any row in the array b[][] such that the total score can be maximized and the score for each pair is calculated as the total indexes at which values of both rows are identical....
There are many ways of classifying algorithms and a few of them are shown below:...
Given N numbers with no duplicates, count the number of unique triplets (ai, aj, ak) such that their XOR is 0. A triplet is said to be unique if all of the three numbers in the triplet are unique....
Given N numbers with no duplicates, count the number of unique triplets (ai, aj, ak) such that their XOR is 0. A triplet is said to be unique if all of the three numbers in the triplet are unique....
Given a number N, the task is to write C program to count the number of 0s and 1s in the binary representation of N....
Given two numbers A and B, the task is to perform BCD Addition of the given numbers....